//
//  LBPhotoBrowser
//  app
//
//  Created by LINAICAI on 16/8/10.
//  Copyright © 2016年 广东联结电子商务有限公司. All rights reserved.
//

#import <Foundation/Foundation.h>
//#import "LBBaseViewController.h"
#import "LBPhoto.h"
@protocol LBPhotoBrowserDelegate <NSObject>
/**
 *  协议可选方法
 */
@optional
- (void)LBPhotoBrowserDidSave;
@end

typedef UIImageView*(^SourceImageViewClosure)(NSInteger);
@interface LBPhotoBrowser: UIViewController
///主页面
@property (nonatomic , strong , readonly)UICollectionView *collectionView;
///布局
@property (nonatomic , strong , readonly)UICollectionViewFlowLayout *layout;
///闭包，通过闭包获取源图
@property (nonatomic , copy)SourceImageViewClosure sourceImageViewClosure;

@property (nonatomic , strong)UIImageView *sourceImageView;
///用来动画的动画目标显示图像
@property (nonatomic , strong)UIImageView *displayImageView;
/**
 *  委托代理
 */
@property(nonatomic , weak) id<LBPhotoBrowserDelegate> delegate;
+ (void)showWithPhotos:(NSArray<LBPhoto *> *)photos selectIndex:(NSUInteger)selectIndex sourceImageViewClosure:(SourceImageViewClosure)sourceImageViewClosure;
- (instancetype)initWithPhotos:(NSArray<LBPhoto *> *)photos selectIndex:(NSUInteger)selectIndex sourceImageViewClosure:(SourceImageViewClosure)sourceImageViewClosure;
- (void)scrolToCurrentIndex:(BOOL)animated;
@end
